import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // 登录页面
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/Login.vue')
    },
    // 重定向
    {
      path: '/',
      redirect: '/login'
    },
    // 首页
    {
      path: '/home',
      name: 'home',
      component: () => import('@/views/Home.vue')
    },
    // 创建订单模块 creatorder
    {
      path:'/createOrder',
      name:'createOrder',
      component:()=>import('@/components/createOrder/AddOrder.vue')

    },
    { // 选择客户页面
      path:'/selectCustom',
      name:'selectCustom',
      component:()=>import('@/components/createOrder/SelectCustom.vue')
    },
    { // 选择菜品
      path:'/SelectVegetable',
      name:'SelectVegetable',
      component:()=>import('@/components/createOrder/SelectVegetable.vue')
    },
    // 支付页面
    {
      path:"/seata",
      name:"seata",
      component:()=>import('@/components/createOrder/Seata.vue')
      

    },
    // 点餐模块 order
    {
      path:'/order',
      name:'order',
      component:()=>import('@/components/order/Order.vue')
    },
    // 订单模块 indent
    {
      path:'/indent',
      name:'indent',
      component:()=>import('@/components/indent/IndentList.vue')
    },
    // 座位模块 seat
    {
      path:'/seat',
      name:'seat',
      component:()=>import('@/components/seat/Seat.vue'),
      redirect:'seat/content1',
      children:[
        {
          path:'content1',
          name:'content1',
          component:()=>import('@/components/seat/Content1.vue')
        },
        {
          path:'content2',
          name:'content2',
          component:()=>import('@/components/seat/Content2.vue')
        },

      ]
    },
    // 我的模块 my
    { //个人信息
      path:'/message',
      name:'message',
      component:()=>import('@/components/my/Message.vue')
    },
    {  //编辑信息
      path:'/editinfo',
      name:'editinfo',
      component:()=>import('@/components/my/Editinfo.vue')
    },
    { // 账户设置
      path:'/account',
      name:'account',
      component:()=>import('@/components/my/Account.vue')
    },
    {  // 更多
      path:'/more',
      name:'more',
      component:()=>import('@/components/more/More.vue'),
    },
    // 店铺详情
    {
      path:'/store_info',
      name:'store_info',
      component:()=>import('@/components/more/StoreInfo.vue')
    },
    // 帮助
    {
      path:'/help',
      name:'help',
      component:()=>import('@/components/more/help.vue'),
      children:[
        // 重定向
        {
          path:'/help',
          redirect: '/help/help_info'
        },
        // 隐私
        {
          path:'/help/help_privacy',
          name:'help_privacy',
          component:()=>import('@/views/pages/helpprivacy.vue')
        },
        // 帮助中心
        {
          path:'/help/help_info',
          name:'help_info',
          component:()=>import('@/views/pages/heleinfo.vue')
        },
        // 应用信息
        {
          path:'/help/help_use',
          name:'help_use',
          component:()=>import('@/views/pages/helpuse.vue')
        }
      ]
    },

    // 商品销售/商品库存
    {
      path:'/goodxskc',
      name:'good_xskc',
      component:()=>import('@/components/more/Goodxskc.vue')
    },
    // 其他
    {
      path:"/more_other",
      name:"more_other",
      component:()=>import('@/components/more/Other.vue')
    },
    // 添加员工
    {
      path:'/add_staff',
      name:'add_staff',
      component:()=>import('@/components/more/Addstaff.vue')
    }
  ]
})

export default router
